<template>
  <div class="edit-check-every">
    <head-top :head-title="$route.params.name" hidden='true' go-back="true"></head-top>
    <div class="content">
      <div @click="StartCheck(item.category_id, item.category_name, relatedId, $route.params.liftNum, item.id, $route.params.id)" v-for="(item,index) in contentEvery" :key="index">
        <mt-cell is-link :title="item.category_name">
          <span style="color: #666;" v-show="item.status === 1">已查验</span>
          <span style="color: #0078de;" v-show="item.status === 0">未查验</span>
          <span style="color: #0078de;" v-show="item.status === 1">编辑</span>
        </mt-cell>
      </div>
    </div>
  </div>
</template>

<script>
import headTop from '../header/Header.vue'
import {editCheckEvery} from '../../api/my.js'

export default {
  name: 'EditCheckEvery',
  data() {
    return {
      contentEvery: []
    }
  },
  components: {
    headTop
  },
  created() {
    this._getCheckEvery()
  },
  methods: {
    _getCheckEvery() {
      editCheckEvery(this.$route.params.id, this.$route.params.categoryid).then(res => {
        if (res.code === 200) {
          this.contentEvery = res.data.data
          this.relatedId = res.data.related_id
        }
      })
    },
    StartCheck(id, name, relatedId, liftNum, hid, mainid) {
      window.location.href = `/GoCheckPublish/${id}/${name}/${relatedId}/${liftNum || 0}/${hid}/${mainid}`
    }
  }
}
</script>

<style lang="scss">
  .edit-check-every{
    padding-top: 40px;
    .content{
      .mint-cell:last-child{
        background-size: 100% 0px;
      }
      .mint-cell-value{
        span{
          font-size: 13px;
          margin-right: 5px;
        }
      }
      .mint-cell-value.is-link {
        margin-right: 10px;
      }
    }
  }
</style>
